import { PORT3 } from "@/api/config/servicePort";
import http from "@/api";
import { RiveIn, RiveOut } from "../interface/rive";
import { defaultParams } from "@/interface/public";

/**
 * @name 撕碎
 */

interface ItemProp {
  workerId: string;
  id: number;
}

// --------投入------
// 1-保存数据
export const riveInSave = (params: RiveIn.Save) => http.post(PORT3 + `/riveIn/save`, params);

// 2-删除数据
export const riveInRemove = (params: ItemProp) => http.post(PORT3 + `/riveIn/remove`, params);

// 3-查询工单下投入明细
export const riveInItemByWorker = (params: defaultParams) => http.get(PORT3 + `/riveIn/itemByWorker/${params.id}`);

// --------产出------
// 1-保存数据
export const riveOutSave = (params: RiveOut.Save) => http.post(PORT3 + `/riveOut/save`, params);

// 2-删除数据
export const riveOutRemove = (params: ItemProp) => http.post(PORT3 + `/riveOut/remove`, params);

// 3-查询工单下投入明细
export const riveOutItemByWorker = (params: defaultParams) => http.get(PORT3 + `/riveOut/itemByWorker/${params.id}`, params);
